package com.swufe.week6;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import android.content.Context;
import android.provider.Telephony;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import androidx.annotation.NonNull;

public class RateAdapter extends ArrayAdapter {
    public RateAdapter(Context context, int resource, ArrayList<Rate> list) {
            super(context,resource,list);
    }
    @NonNull

    public View getview(int position,View convertView,ViewGroup parent) {
        View itemView=convertView;
        if (itemView==null){
            itemView=LayoutInflater.from(getContext()).inflate(R.layout.my_list,
                    parent,
                    false);
        }
       Rate rate =(Rate)getItem(position);
        TextView title=(TextView)itemView.findViewById(R.id.itemTitle);
        TextView detail=(TextView)itemView.findViewById(R.id.itemDetail);
       // title.setText(""+rate.getCname);
       // detail.setText(""+rate.getCval);
        return itemView;
    }
}
